﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Sustainalytics.Caching;
using System.Configuration;

namespace Sustainalytics.Synchronization.BusinessLogic.Tests
{
    [TestClass]
    public class RedisRepositoryTests
    {
        [TestMethod]
        public void SetClientDWConnectionString()
        {
            const int databaseId = 12;

            var redisCache = new AppRedisCache(ConfigurationManager.AppSettings["RedisServer"], databaseId, true);
            var redisRepository = RedisRepository.GetInstance(redisCache);

            var connectionString = string.Format("{0}/{1}", ConfigurationManager.ConnectionStrings["MongoDBConnectionString"].ConnectionString, "ClientDWTests");

            var result = redisRepository.SetClientDWConnectionString(connectionString);

            Assert.IsTrue(result, "We expected that the returned result to be true.");
        }
    }
}
